Integrand size = 15, antiderivative size = 68 \[ \int \cos (c+d x) \sin ^2(a+b x) \, dx=-\frac {\sin (2 a-c+(2 b-d) x)}{4 (2 b-d)}+\frac {\sin (c+d x)}{2 d}-\frac {\sin (2 a+c+(2 b+d) x)}{4 (2 b+d)} \]
Time = 0.92 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.12 \[ \int \cos (c+d x) \sin ^2(a+b x) \, dx=\frac {1}{4} \left (\frac {2 \cos (d x) \sin (c)}{d}+\frac {2 \cos (c) \sin (d x)}{d}-\frac {\sin (2 a-c+2 b x-d x)}{2 b-d}-\frac {\sin (2 a+c+2 b x+d x)}{2 b+d}\right ) \]
((2*Cos[d*x]*Sin[c])/d + (2*Cos[c]*Sin[d*x])/d - Sin[2*a - c + 2*b*x - d*x ]/(2*b - d) - Sin[2*a + c + 2*b*x + d*x]/(2*b + d))/4
Time = 0.23 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {5085, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sin ^2(a+b x) \cos (c+d x) \, dx\) |
\(\Big \downarrow \) 5085 |
\(\displaystyle \int \left (-\frac {1}{4} \cos (2 a+x (2 b-d)-c)-\frac {1}{4} \cos (2 a+x (2 b+d)+c)+\frac {1}{2} \cos (c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\sin (2 a+x (2 b-d)-c)}{4 (2 b-d)}-\frac {\sin (2 a+x (2 b+d)+c)}{4 (2 b+d)}+\frac {\sin (c+d x)}{2 d}\) |
-1/4*Sin[2*a - c + (2*b - d)*x]/(2*b - d) + Sin[c + d*x]/(2*d) - Sin[2*a + c + (2*b + d)*x]/(4*(2*b + d))
3.3.20.3.1 Defintions of rubi rules used
Int[Cos[w_]^(q_.)*Sin[v_]^(p_.), x_Symbol] :> Int[ExpandTrigReduce[Sin[v]^p *Cos[w]^q, x], x] /; IGtQ[p, 0] && IGtQ[q, 0] && ((PolynomialQ[v, x] && Pol ynomialQ[w, x]) || (BinomialQ[{v, w}, x] && IndependentQ[Cancel[v/w], x]))
Time = 0.54 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.93
method | result | size |
default | \(-\frac {\sin \left (2 a -c +\left (2 b -d \right ) x \right )}{4 \left (2 b -d \right )}+\frac {\sin \left (d x +c \right )}{2 d}-\frac {\sin \left (2 a +c +\left (2 b +d \right ) x \right )}{4 \left (2 b +d \right )}\) | \(63\) |
parallelrisch | \(\frac {\left (-2 b d -d^{2}\right ) \sin \left (2 a -c +\left (2 b -d \right ) x \right )+\left (-2 b d +d^{2}\right ) \sin \left (2 a +c +\left (2 b +d \right ) x \right )+\left (8 b^{2}-2 d^{2}\right ) \sin \left (d x +c \right )}{16 b^{2} d -4 d^{3}}\) | \(85\) |
risch | \(\frac {2 \sin \left (d x +c \right ) b^{2}}{d \left (2 b -d \right ) \left (2 b +d \right )}-\frac {d \sin \left (d x +c \right )}{2 \left (2 b -d \right ) \left (2 b +d \right )}-\frac {\sin \left (2 x b -d x +2 a -c \right ) b}{2 \left (2 b -d \right ) \left (2 b +d \right )}-\frac {d \sin \left (2 x b -d x +2 a -c \right )}{4 \left (2 b -d \right ) \left (2 b +d \right )}-\frac {\sin \left (2 x b +d x +2 a +c \right ) b}{2 \left (2 b -d \right ) \left (2 b +d \right )}+\frac {d \sin \left (2 x b +d x +2 a +c \right )}{4 \left (2 b -d \right ) \left (2 b +d \right )}\) | \(191\) |
norman | \(\frac {-\frac {4 b \tan \left (\frac {a}{2}+\frac {x b}{2}\right )}{4 b^{2}-d^{2}}+\frac {4 b \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3}}{4 b^{2}-d^{2}}+\frac {4 b \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{4 b^{2}-d^{2}}-\frac {4 b \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{4 b^{2}-d^{2}}+\frac {4 b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (4 b^{2}-d^{2}\right ) d}+\frac {4 b^{2} \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (4 b^{2}-d^{2}\right ) d}+\frac {8 \left (b^{2}-d^{2}\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \left (4 b^{2}-d^{2}\right )}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )^{2}}\) | \(277\) |
Time = 0.25 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.03 \[ \int \cos (c+d x) \sin ^2(a+b x) \, dx=-\frac {2 \, b d \cos \left (b x + a\right ) \cos \left (d x + c\right ) \sin \left (b x + a\right ) - {\left (d^{2} \cos \left (b x + a\right )^{2} + 2 \, b^{2} - d^{2}\right )} \sin \left (d x + c\right )}{4 \, b^{2} d - d^{3}} \]
-(2*b*d*cos(b*x + a)*cos(d*x + c)*sin(b*x + a) - (d^2*cos(b*x + a)^2 + 2*b ^2 - d^2)*sin(d*x + c))/(4*b^2*d - d^3)
Leaf count of result is larger than twice the leaf count of optimal. 410 vs. \(2 (49) = 98\).
Time = 0.72 (sec) , antiderivative size = 410, normalized size of antiderivative = 6.03 \[ \int \cos (c+d x) \sin ^2(a+b x) \, dx=\begin {cases} x \sin ^{2}{\left (a \right )} \cos {\left (c \right )} & \text {for}\: b = 0 \wedge d = 0 \\\frac {x \sin ^{2}{\left (a - \frac {d x}{2} \right )} \cos {\left (c + d x \right )}}{4} + \frac {x \sin {\left (a - \frac {d x}{2} \right )} \sin {\left (c + d x \right )} \cos {\left (a - \frac {d x}{2} \right )}}{2} - \frac {x \cos ^{2}{\left (a - \frac {d x}{2} \right )} \cos {\left (c + d x \right )}}{4} + \frac {3 \sin {\left (a - \frac {d x}{2} \right )} \cos {\left (a - \frac {d x}{2} \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {\sin {\left (c + d x \right )} \cos ^{2}{\left (a - \frac {d x}{2} \right )}}{d} & \text {for}\: b = - \frac {d}{2} \\\frac {x \sin ^{2}{\left (a + \frac {d x}{2} \right )} \cos {\left (c + d x \right )}}{4} - \frac {x \sin {\left (a + \frac {d x}{2} \right )} \sin {\left (c + d x \right )} \cos {\left (a + \frac {d x}{2} \right )}}{2} - \frac {x \cos ^{2}{\left (a + \frac {d x}{2} \right )} \cos {\left (c + d x \right )}}{4} + \frac {\sin ^{2}{\left (a + \frac {d x}{2} \right )} \sin {\left (c + d x \right )}}{d} + \frac {\sin {\left (a + \frac {d x}{2} \right )} \cos {\left (a + \frac {d x}{2} \right )} \cos {\left (c + d x \right )}}{2 d} & \text {for}\: b = \frac {d}{2} \\\left (\frac {x \sin ^{2}{\left (a + b x \right )}}{2} + \frac {x \cos ^{2}{\left (a + b x \right )}}{2} - \frac {\sin {\left (a + b x \right )} \cos {\left (a + b x \right )}}{2 b}\right ) \cos {\left (c \right )} & \text {for}\: d = 0 \\\frac {2 b^{2} \sin ^{2}{\left (a + b x \right )} \sin {\left (c + d x \right )}}{4 b^{2} d - d^{3}} + \frac {2 b^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (a + b x \right )}}{4 b^{2} d - d^{3}} - \frac {2 b d \sin {\left (a + b x \right )} \cos {\left (a + b x \right )} \cos {\left (c + d x \right )}}{4 b^{2} d - d^{3}} - \frac {d^{2} \sin ^{2}{\left (a + b x \right )} \sin {\left (c + d x \right )}}{4 b^{2} d - d^{3}} & \text {otherwise} \end {cases} \]
Piecewise((x*sin(a)**2*cos(c), Eq(b, 0) & Eq(d, 0)), (x*sin(a - d*x/2)**2* cos(c + d*x)/4 + x*sin(a - d*x/2)*sin(c + d*x)*cos(a - d*x/2)/2 - x*cos(a - d*x/2)**2*cos(c + d*x)/4 + 3*sin(a - d*x/2)*cos(a - d*x/2)*cos(c + d*x)/ (2*d) + sin(c + d*x)*cos(a - d*x/2)**2/d, Eq(b, -d/2)), (x*sin(a + d*x/2)* *2*cos(c + d*x)/4 - x*sin(a + d*x/2)*sin(c + d*x)*cos(a + d*x/2)/2 - x*cos (a + d*x/2)**2*cos(c + d*x)/4 + sin(a + d*x/2)**2*sin(c + d*x)/d + sin(a + d*x/2)*cos(a + d*x/2)*cos(c + d*x)/(2*d), Eq(b, d/2)), ((x*sin(a + b*x)** 2/2 + x*cos(a + b*x)**2/2 - sin(a + b*x)*cos(a + b*x)/(2*b))*cos(c), Eq(d, 0)), (2*b**2*sin(a + b*x)**2*sin(c + d*x)/(4*b**2*d - d**3) + 2*b**2*sin( c + d*x)*cos(a + b*x)**2/(4*b**2*d - d**3) - 2*b*d*sin(a + b*x)*cos(a + b* x)*cos(c + d*x)/(4*b**2*d - d**3) - d**2*sin(a + b*x)**2*sin(c + d*x)/(4*b **2*d - d**3), True))
Leaf count of result is larger than twice the leaf count of optimal. 371 vs. \(2 (62) = 124\).
Time = 0.24 (sec) , antiderivative size = 371, normalized size of antiderivative = 5.46 \[ \int \cos (c+d x) \sin ^2(a+b x) \, dx=-\frac {{\left (2 \, b d \sin \left (c\right ) - d^{2} \sin \left (c\right )\right )} \cos \left ({\left (2 \, b + d\right )} x + 2 \, a + 2 \, c\right ) - {\left (2 \, b d \sin \left (c\right ) - d^{2} \sin \left (c\right )\right )} \cos \left ({\left (2 \, b + d\right )} x + 2 \, a\right ) - {\left (2 \, b d \sin \left (c\right ) + d^{2} \sin \left (c\right )\right )} \cos \left (-{\left (2 \, b - d\right )} x - 2 \, a + 2 \, c\right ) + {\left (2 \, b d \sin \left (c\right ) + d^{2} \sin \left (c\right )\right )} \cos \left (-{\left (2 \, b - d\right )} x - 2 \, a\right ) - 2 \, {\left (4 \, b^{2} \sin \left (c\right ) - d^{2} \sin \left (c\right )\right )} \cos \left (d x + 2 \, c\right ) + 2 \, {\left (4 \, b^{2} \sin \left (c\right ) - d^{2} \sin \left (c\right )\right )} \cos \left (d x\right ) - {\left (2 \, b d \cos \left (c\right ) - d^{2} \cos \left (c\right )\right )} \sin \left ({\left (2 \, b + d\right )} x + 2 \, a + 2 \, c\right ) - {\left (2 \, b d \cos \left (c\right ) - d^{2} \cos \left (c\right )\right )} \sin \left ({\left (2 \, b + d\right )} x + 2 \, a\right ) + {\left (2 \, b d \cos \left (c\right ) + d^{2} \cos \left (c\right )\right )} \sin \left (-{\left (2 \, b - d\right )} x - 2 \, a + 2 \, c\right ) + {\left (2 \, b d \cos \left (c\right ) + d^{2} \cos \left (c\right )\right )} \sin \left (-{\left (2 \, b - d\right )} x - 2 \, a\right ) + 2 \, {\left (4 \, b^{2} \cos \left (c\right ) - d^{2} \cos \left (c\right )\right )} \sin \left (d x + 2 \, c\right ) + 2 \, {\left (4 \, b^{2} \cos \left (c\right ) - d^{2} \cos \left (c\right )\right )} \sin \left (d x\right )}{8 \, {\left ({\left (\cos \left (c\right )^{2} + \sin \left (c\right )^{2}\right )} d^{3} - 4 \, {\left (b^{2} \cos \left (c\right )^{2} + b^{2} \sin \left (c\right )^{2}\right )} d\right )}} \]
-1/8*((2*b*d*sin(c) - d^2*sin(c))*cos((2*b + d)*x + 2*a + 2*c) - (2*b*d*si n(c) - d^2*sin(c))*cos((2*b + d)*x + 2*a) - (2*b*d*sin(c) + d^2*sin(c))*co s(-(2*b - d)*x - 2*a + 2*c) + (2*b*d*sin(c) + d^2*sin(c))*cos(-(2*b - d)*x - 2*a) - 2*(4*b^2*sin(c) - d^2*sin(c))*cos(d*x + 2*c) + 2*(4*b^2*sin(c) - d^2*sin(c))*cos(d*x) - (2*b*d*cos(c) - d^2*cos(c))*sin((2*b + d)*x + 2*a + 2*c) - (2*b*d*cos(c) - d^2*cos(c))*sin((2*b + d)*x + 2*a) + (2*b*d*cos(c ) + d^2*cos(c))*sin(-(2*b - d)*x - 2*a + 2*c) + (2*b*d*cos(c) + d^2*cos(c) )*sin(-(2*b - d)*x - 2*a) + 2*(4*b^2*cos(c) - d^2*cos(c))*sin(d*x + 2*c) + 2*(4*b^2*cos(c) - d^2*cos(c))*sin(d*x))/((cos(c)^2 + sin(c)^2)*d^3 - 4*(b ^2*cos(c)^2 + b^2*sin(c)^2)*d)
Time = 0.28 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.90 \[ \int \cos (c+d x) \sin ^2(a+b x) \, dx=-\frac {\sin \left (2 \, b x + d x + 2 \, a + c\right )}{4 \, {\left (2 \, b + d\right )}} - \frac {\sin \left (2 \, b x - d x + 2 \, a - c\right )}{4 \, {\left (2 \, b - d\right )}} + \frac {\sin \left (d x + c\right )}{2 \, d} \]
-1/4*sin(2*b*x + d*x + 2*a + c)/(2*b + d) - 1/4*sin(2*b*x - d*x + 2*a - c) /(2*b - d) + 1/2*sin(d*x + c)/d
Time = 21.08 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.54 \[ \int \cos (c+d x) \sin ^2(a+b x) \, dx=\frac {\sin \left (c+d\,x\right )}{2\,d}-\frac {b\,\left (2\,d\,\sin \left (2\,a+c+2\,b\,x+d\,x\right )+2\,d\,\sin \left (2\,a-c+2\,b\,x-d\,x\right )\right )-d^2\,\sin \left (2\,a+c+2\,b\,x+d\,x\right )+d^2\,\sin \left (2\,a-c+2\,b\,x-d\,x\right )}{16\,b^2\,d-4\,d^3} \]